package io.renren.modules.app.controller.info;

import io.renren.common.utils.PageUtils;
import io.renren.common.utils.R;
import io.renren.modules.app.entity.info.PositionTypeEntity;
import io.renren.modules.app.service.info.PositionTypeService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.Map;


/**
 * 
 *
 * @date 2023-12-12 12:41:34
 */
@RestController
@RequestMapping("positionType")
public class PositionTypeController {
    @Autowired
    private PositionTypeService PositionTypeService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params){

        return R.ok();
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Integer id){
		PositionTypeEntity PositionType = PositionTypeService.getById(id);

        return R.ok().put("PositionType", PositionType);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody PositionTypeEntity PositionType){
		PositionTypeService.save(PositionType);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody PositionTypeEntity PositionType){
		PositionTypeService.updateById(PositionType);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] ids){
		PositionTypeService.removeByIds(Arrays.asList(ids));
        return R.ok();
    }

}
